From c9deb7c4a3d3907179915cfa813cc8799e11668e Mon Sep 17 00:00:00 2001 From: "kaf24@firebug.cl.cam.ac.uk" Date: Sat, 23 Dec 2006 09:38:07 +0000 Subject: [PATCH] More 'const' cleanups (and fixes, for Solaris). Signed-off-by: Keir Fraser --- tools/xenstat/xentop/xentop.c | 4 ++-- xen/common/gdbstub.c | 2 +- xen/include/asm-x86/bitops.h | 3 ++- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/tools/xenstat/xentop/xentop.c b/tools/xenstat/xentop/xentop.c index f88fd26742..a2ea23a735 100644 --- a/tools/xenstat/xentop/xentop.c +++ b/tools/xenstat/xentop/xentop.c @@ -269,7 +269,7 @@ static void print(const char *fmt, ...) if (!batch) { if((current_row() < lines()-1)) { va_start(args, fmt); - vwprintw(stdscr, (const char *)fmt, args); + vwprintw(stdscr, fmt, args); va_end(args); } } else { @@ -283,7 +283,7 @@ static void print(const char *fmt, ...) static void attr_addstr(int attr, const char *str) { attron(attr); - addstr((const char *)str); + addstr(str); attroff(attr); } diff --git a/xen/common/gdbstub.c b/xen/common/gdbstub.c index de3ba1f40f..8c863080e0 100644 --- a/xen/common/gdbstub.c +++ b/xen/common/gdbstub.c @@ -382,7 +382,7 @@ gdbstub_detach(struct gdb_context *ctx) static int process_command(struct cpu_user_regs *regs, struct gdb_context *ctx) { - char *ptr; + const char *ptr; unsigned long addr, length; int resume = 0; diff --git a/xen/include/asm-x86/bitops.h b/xen/include/asm-x86/bitops.h index d3d3b5dfbc..8cb4693fab 100644 --- a/xen/include/asm-x86/bitops.h +++ b/xen/include/asm-x86/bitops.h @@ -23,6 +23,7 @@ */ #define ADDR (*(volatile long *) addr) +#define CONST_ADDR (*(const volatile long *) addr) /** * set_bit - Atomically set a bit in memory @@ -253,7 +254,7 @@ static __inline__ int variable_test_bit(int nr, const volatile void * addr) __asm__ __volatile__( "btl %2,%1\n\tsbbl %0,%0" :"=r" (oldbit) - :"m" (ADDR),"dIr" (nr)); + :"m" (CONST_ADDR),"dIr" (nr)); return oldbit; } -- 2.30.2